# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Proposal do
  @moduledoc """
  Represents a proposal in the Marketplace. A proposal is the unit of negotiation between a seller and a buyer.

  ## Attributes

  *   `billedBuyer` (*type:* `String.t`, *default:* `nil`) - Output only. When the client field is populated, this field refers to the buyer who creates and manages the client buyer and gets billed on behalf of the client buyer; when the buyer field is populated, this field is the same value as buyer. Format : `buyers/{buyerAccountId}`
  *   `buyer` (*type:* `String.t`, *default:* `nil`) - Output only. Refers to a buyer in The Realtime-bidding API. Format: `buyers/{buyerAccountId}`
  *   `buyerContacts` (*type:* `list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact.t)`, *default:* `nil`) - Contact information for the buyer.
  *   `buyerPrivateData` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.PrivateData.t`, *default:* `nil`) - Buyer private data (hidden from seller).
  *   `client` (*type:* `String.t`, *default:* `nil`) - Output only. Refers to a Client. Format: `buyers/{buyerAccountId}/clients/{clientAccountid}`
  *   `dealType` (*type:* `String.t`, *default:* `nil`) - Output only. Type of deal the proposal contains.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The descriptive name for the proposal. Maximum length of 255 unicode characters is allowed. Control characters are not allowed. Buyers cannot update this field. Note: Not to be confused with name, which is a unique identifier of the proposal.
  *   `isRenegotiating` (*type:* `boolean()`, *default:* `nil`) - Output only. True if the proposal was previously finalized and is now being renegotiated.
  *   `lastUpdaterOrCommentorRole` (*type:* `String.t`, *default:* `nil`) - Output only. The role of the last user that either updated the proposal or left a comment.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the proposal serving as a unique identifier. Format: buyers/{accountId}/proposals/{proposalId}
  *   `notes` (*type:* `list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Note.t)`, *default:* `nil`) - A list of notes from the buyer and the seller attached to this proposal.
  *   `originatorRole` (*type:* `String.t`, *default:* `nil`) - Output only. Indicates whether the buyer/seller created the proposal.
  *   `pausingConsented` (*type:* `boolean()`, *default:* `nil`) - Whether pausing is allowed for the proposal. This is a negotiable term between buyers and publishers.
  *   `proposalRevision` (*type:* `String.t`, *default:* `nil`) - Output only. The revision number for the proposal. Each update to the proposal or deal causes the proposal revision number to auto-increment. The buyer keeps track of the last revision number they know of and pass it in when making an update. If the head revision number on the server has since incremented, then an ABORTED error is returned during the update operation to let the buyer know that a subsequent update was made.
  *   `publisherProfile` (*type:* `String.t`, *default:* `nil`) - Immutable. Reference to the seller on the proposal. Format: `buyers/{buyerAccountId}/publisherProfiles/{publisherProfileId}` Note: This field may be set only when creating the resource. Modifying this field while updating the resource will result in an error.
  *   `sellerContacts` (*type:* `list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact.t)`, *default:* `nil`) - Output only. Contact information for the seller.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. Indicates the state of the proposal.
  *   `termsAndConditions` (*type:* `String.t`, *default:* `nil`) - Output only. The terms and conditions associated with this proposal. Accepting a proposal implies acceptance of this field. This is created by the seller, the buyer can only view it.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the proposal was last revised.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :billedBuyer => String.t() | nil,
          :buyer => String.t() | nil,
          :buyerContacts =>
            list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact.t()) | nil,
          :buyerPrivateData =>
            GoogleApi.AuthorizedBuyersMarketplace.V1.Model.PrivateData.t() | nil,
          :client => String.t() | nil,
          :dealType => String.t() | nil,
          :displayName => String.t() | nil,
          :isRenegotiating => boolean() | nil,
          :lastUpdaterOrCommentorRole => String.t() | nil,
          :name => String.t() | nil,
          :notes => list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Note.t()) | nil,
          :originatorRole => String.t() | nil,
          :pausingConsented => boolean() | nil,
          :proposalRevision => String.t() | nil,
          :publisherProfile => String.t() | nil,
          :sellerContacts =>
            list(GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact.t()) | nil,
          :state => String.t() | nil,
          :termsAndConditions => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:billedBuyer)
  field(:buyer)
  field(:buyerContacts, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact, type: :list)
  field(:buyerPrivateData, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.PrivateData)
  field(:client)
  field(:dealType)
  field(:displayName)
  field(:isRenegotiating)
  field(:lastUpdaterOrCommentorRole)
  field(:name)
  field(:notes, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Note, type: :list)
  field(:originatorRole)
  field(:pausingConsented)
  field(:proposalRevision)
  field(:publisherProfile)
  field(:sellerContacts, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Contact, type: :list)
  field(:state)
  field(:termsAndConditions)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Proposal do
  def decode(value, options) do
    GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Proposal.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Proposal do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
